package com.ruoyi.info.service.impl;

import com.ruoyi.info.domain.FhInfoPointsHistory;
import com.ruoyi.info.mapper.FhInfoPointsHistoryMapper;
import com.ruoyi.info.service.IFhInfoPointsHistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 积分流水表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-XX
 */
@Service
public class FhInfoPointsHistoryServiceImpl implements IFhInfoPointsHistoryService 
{
    @Autowired
    private FhInfoPointsHistoryMapper fhInfoPointsHistoryMapper;

    /**
     * 查询积分流水表
     * 
     * @param id 积分流水表主键
     * @return 积分流水表
     */
    @Override
    public FhInfoPointsHistory selectFhInfoPointsHistoryById(Long id)
    {
        return fhInfoPointsHistoryMapper.selectFhInfoPointsHistoryById(id);
    }

    /**
     * 查询积分流水表列表
     * 
     * @param fhInfoPointsHistory 积分流水表
     * @return 积分流水表
     */
    @Override
    public List<FhInfoPointsHistory> selectFhInfoPointsHistoryList(FhInfoPointsHistory fhInfoPointsHistory)
    {
        return fhInfoPointsHistoryMapper.selectFhInfoPointsHistoryList(fhInfoPointsHistory);
    }

    /**
     * 新增积分流水表
     * 
     * @param fhInfoPointsHistory 积分流水表
     * @return 结果
     */
    @Override
    public int insertFhInfoPointsHistory(FhInfoPointsHistory fhInfoPointsHistory)
    {
        if (fhInfoPointsHistory.getCreateTime() == null) {
            fhInfoPointsHistory.setCreateTime(LocalDateTime.now());
        }
        return fhInfoPointsHistoryMapper.insertFhInfoPointsHistory(fhInfoPointsHistory);
    }

    /**
     * 修改积分流水表
     * 
     * @param fhInfoPointsHistory 积分流水表
     * @return 结果
     */
    @Override
    public int updateFhInfoPointsHistory(FhInfoPointsHistory fhInfoPointsHistory)
    {
        return fhInfoPointsHistoryMapper.updateFhInfoPointsHistory(fhInfoPointsHistory);
    }

    /**
     * 批量删除积分流水表
     * 
     * @param ids 需要删除的积分流水表主键
     * @return 结果
     */
    @Override
    public int deleteFhInfoPointsHistoryByIds(Long[] ids)
    {
        return fhInfoPointsHistoryMapper.deleteFhInfoPointsHistoryByIds(ids);
    }

    /**
     * 删除积分流水表信息
     * 
     * @param id 积分流水表主键
     * @return 结果
     */
    @Override
    public int deleteFhInfoPointsHistoryById(Long id)
    {
        return fhInfoPointsHistoryMapper.deleteFhInfoPointsHistoryById(id);
    }
}

